import React, { Component } from 'react';
import BarsChart from '@/components/Bars/BarsChart';
import generateData from '../utils/generate';
import styles from './Bars.less';

export default class BarsView extends Component {

  constructor(props) {
    super(props);
    this.state = {
      data: generateData(Math.floor(8 + 8 * Math.random())),
    };
  }

  render() {
    const { data } = this.state;
    return (
      <div>
        <BarsChart
          className={styles.barsChart}
          width={400}
          height={300}
          data={data}
        />
      </div>
    );
  }
}
